<template>
    <NConfigProvider :theme>
        <FormRender :renders="RenderFuncs" :form :initValue @submit="onSubmit" @failed="onFailed" @inited="onInited" debug />
    </NConfigProvider>
</template>

<script setup>
    import { ref, computed } from 'vue'
    import { NConfigProvider, darkTheme } from 'naive-ui'

    import { FormRender, RenderFuncs } from "@grid-form/render-naive"
    import { renderProps } from "."

    import { useData } from 'vitepress'

    const props = defineProps(renderProps)

    const { isDark } = useData()
    const theme = computed(()=>isDark.value===true ? darkTheme : null)
</script>
